package WebRoot.demo4.controller;

import java.util.ArrayList;
import java.util.Arrays;
import java.util.List;

/**
 * @author Administrator
 *
 */
public class Clus_count {
	
	String keyscol = null;
	
	Long countcols = 0l;
	
	List<Object> collist;
	
	public String getKeyscol() {
		return keyscol;
	}

	public void setKeyscol(String keyscol) {
		this.keyscol = keyscol;
	}

	public Long getCountcols() {
		return countcols;
	}

	public void setCountcols(Long countcols) {
		this.countcols = countcols;
	}

	
	public Clus_count(String _keyscol, Long _countcols,List<Object> _collist) {
		keyscol = _keyscol;
		countcols = _countcols;
		collist = _collist;
	}
	
	public Clus_count(String _keyscol, Long _countcols) {
		keyscol = _keyscol;
		countcols = _countcols;
	}
	

	public List<Object> getCollist() {
		return collist;
	}

	public void setCollist(List<Object> collist) {
		this.collist = collist;
	}

	public ArrayList<Object> getCluList(long fromIndex,long toIndex){
		if (collist!=null) {
			int fromInt = (int)fromIndex;
			int endInt = (int)toIndex;
			List<Object> list = collist.subList(fromInt, endInt);
			ArrayList<Object> aList = new ArrayList<>();
			aList.addAll(list);
			aList.add(collist.get(endInt));
			return aList;
		}
		return new ArrayList<>();
	}
	
}
